package view.component.monster.large_monster
{
	import enums.main.UISize;
	
	import feathers.controls.Screen;
	import feathers.controls.ScrollContainer;
	import feathers.controls.Scroller;
	
	
	/**
	 * 大型怪物情报界面
	 * @author £iang
	 * 
	 */	
	public class LargeMonsterView extends Screen
	{
		//-----------------------------
		// variables
		//-----------------------------
		
		/** 滚动条容器界面 */
		public var mainContainer:ScrollContainer;
		/** 大型怪物列表界面 */
		public var listView:LMonsterListView;
		/** 大型怪物详细信息界面 */
		public var detailView:LMonsterDetailView;
		
		//-----------------------------
		// properties
		//-----------------------------
		
		//-----------------------------
		// setter&getter
		//-----------------------------
		
		//-----------------------------
		// methods
		//-----------------------------
		
		override protected function initialize():void
		{
			mainContainer = new ScrollContainer();
			mainContainer.width = UISize.MAIN_W;
			mainContainer.height = UISize.MAIN_H - UISize.MONSTER_TAB_AREA_H * this.dpiScale;
			mainContainer.scrollerProperties.hasElasticEdges = false;
			mainContainer.scrollerProperties.snapToPages = true;
			mainContainer.scrollerProperties.throwEase = "easeOut";
			mainContainer.scrollerProperties.interactionMode = 
				Scroller.INTERACTION_MODE_MOUSE;
			mainContainer.scrollerProperties.scrollBarDisplayMode = 
				Scroller.SCROLL_BAR_DISPLAY_MODE_NONE;
			this.addChild( mainContainer );
			
			listView = new LMonsterListView();
			listView.width = UISize.MAIN_W;
			mainContainer.addChild( listView );
			
			detailView = new LMonsterDetailView();
			detailView.width = UISize.MAIN_W;
			detailView.x = UISize.MAIN_W;
			mainContainer.addChild( detailView );
		}
		
		/**
		 * 将滚动条移动至某一页
		 * @param pageIndex 页面下标
		 * 
		 */		
		public function changePage( pageIndex:int ):void
		{
			mainContainer.scrollToPageIndex( pageIndex, 0, 0.7 );
		}
		
		//-----------------------------
		// events
		//-----------------------------
		
		//-----------------------------
		// dispose
		//-----------------------------
		
		/**
		 * 析构函数 
		 * 
		 */		
		override public function dispose():void
		{
			super.dispose();
		}
		
		//-----------------------------
		// construction
		//-----------------------------
		
		/**
		 * 构造函数
		 *
		 */
		public function LargeMonsterView()
		{
			super();
		}
	}
}